﻿namespace WopiHost.Core.Models;

/// <summary>
/// Model according to <see href="https://learn.microsoft.com/en-us/microsoft-365/cloud-storage-partner-program/rest/files/checkfileinfo/checkfileinfo-response#wopi-host-capabilities-properties">WOPI host capabilities properties</see>
/// </summary>
public class HostCapabilities
{
    /// <summary>
    /// 表示WOPI服务器是否支持多用户同时对此文件进行更改的布尔值。
    /// </summary>
    public bool SupportsCoauth { get; set; }

    /// <summary>
    /// 表示主机是否支持以下WOPI操作：
    /// <list type="bullet">
    /// <item>
    /// <description>ExecuteCellStorageRequest</description>
    /// </item>
    /// <item>
    /// <description>ExecuteCellStorageRelativeRequest</description>
    /// </item>
    /// </list>
    /// 这些操作仅由OneNote Web使用，因此不需要与Office Web或Office for iOS集成。这些操作仅为完整性而包含，但不需要实现。
    /// </summary>
    public bool SupportsCobalt { get; set; }

    /// <summary>
    /// 表示主机是否支持以下WOPI操作：
    /// <list type="bullet">
    /// <item>
    /// <description>CheckFolderInfo - 此操作仅由OneNote Web使用，因此不需要与Office Web或Office for iOS集成。这些操作仅为完整性而包含，但不需要实现。</description>
    /// </item>
    /// <item>
    /// <description>EnumerateChildren (folders) - 此操作仅由OneNote Web使用，因此不需要与Office Web或Office for iOS集成。这些操作仅为完整性而包含，但不需要实现。</description>
    /// </item>
    /// <item>
    /// <description><see href="https://learn.microsoft.com/en-us/microsoft-365/cloud-storage-partner-program/rest/files/deletefile">DeleteFile</see></description>
    /// </item>
    /// </list>
    /// </summary>  
    public bool SupportsFolders { get; set; }

    /// <summary>
    /// 表示主机是否支持以下WOPI操作：
    /// <list type="bullet">
    /// <item>
    /// <description><see href="https://learn.microsoft.com/en-us/microsoft-365/cloud-storage-partner-program/rest/containers/checkcontainerinfo">CheckContainerInfo</see></description>
    /// </item>
    /// <item>
    /// <description><see href="https://learn.microsoft.com/en-us/microsoft-365/cloud-storage-partner-program/rest/containers/createchildcontainer">CreateChildContainer</see></description>
    /// </item>
    /// <item>
    /// <description><see href="https://learn.microsoft.com/en-us/microsoft-365/cloud-storage-partner-program/rest/containers/createchildfile">CreateChildFile</see></description>
    /// </item>
    /// <item>
    /// <description><see href="https://learn.microsoft.com/en-us/microsoft-365/cloud-storage-partner-program/rest/containers/deletecontainer">DeleteContainer</see></description>
    /// </item>
    /// <item>
    /// <description><see href="https://learn.microsoft.com/en-us/microsoft-365/cloud-storage-partner-program/rest/files/deletefile">DeleteFile</see></description>
    /// </item>
    /// <item>
    /// <description><see href="https://learn.microsoft.com/en-us/microsoft-365/cloud-storage-partner-program/rest/containers/enumerateancestors">EnumerateAncestors (containers)</see></description>
    /// </item>
    /// <item>
    /// <description><see href="https://learn.microsoft.com/en-us/microsoft-365/cloud-storage-partner-program/rest/files/enumerateancestors">EnumerateAncestors (files)</see></description>
    /// </item>
    /// <item>
    /// <description><see href="https://learn.microsoft.com/en-us/microsoft-365/cloud-storage-partner-program/rest/containers/enumeratechildren">EnumerateChildren (containers)</see></description>
    /// </item>
    /// <item>
    /// <description><see href="https://learn.microsoft.com/en-us/microsoft-365/cloud-storage-partner-program/rest/containers/getecosystem">GetEcosystem (containers)</see></description>
    /// </item>
    /// <item>
    /// <description><see href="https://learn.microsoft.com/en-us/microsoft-365/cloud-storage-partner-program/rest/containers/renamecontainer">RenameContainer</see></description>
    /// </item>
    /// </list>
    /// </summary>
    public bool SupportsContainers { get; set; }

    /// <summary>
    /// 表示主机是否支持以下WOPI操作：
    /// <list type="bullet">
    /// <item>
    /// <description><see href="https://learn.microsoft.com/en-us/microsoft-365/cloud-storage-partner-program/rest/files/lock">Lock</see></description>
    /// </item>
    /// <item>
    /// <description><see href="https://learn.microsoft.com/en-us/microsoft-365/cloud-storage-partner-program/rest/files/unlock">Unlock</see></description>
    /// </item>
    /// <item>
    /// <description><see href="https://learn.microsoft.com/en-us/microsoft-365/cloud-storage-partner-program/rest/files/refreshlock">RefreshLock</see></description>
    /// </item>
    /// <item>
    /// <description><see href="https://learn.microsoft.com/en-us/microsoft-365/cloud-storage-partner-program/rest/files/unlockandrelock">UnlockAndRelock</see> 操作。</description>
    /// </item>
    /// </list>
    /// </summary>
    public bool SupportsLocks { get; set; }

    /// <summary>
    /// 表示主机是否支持 <see href="https://learn.microsoft.com/en-us/microsoft-365/cloud-storage-partner-program/rest/files/getlock">GetLock</see> 操作。
    /// </summary>
    public bool SupportsGetLock { get; set; }

    /// <summary>
    /// 表示主机是否支持锁定ID长达1024个ASCII字符。如果未提供，WOPI客户端将假定锁定ID仅限于256个ASCII字符。
    /// </summary>
    public bool SupportsExtendedLockLength { get; set; }

    /// <summary>
    /// 表示主机是否支持以下WOPI操作：
    /// <list type="bullet">
    /// <item>
    /// <description><see href="https://learn.microsoft.com/en-us/microsoft-365/cloud-storage-partner-program/rest/ecosystem/checkecosystem">CheckEcosystem</see></description>
    /// </item>
    /// <item>
    /// <description><see href="https://learn.microsoft.com/en-us/microsoft-365/cloud-storage-partner-program/rest/containers/getecosystem">GetEcosystem (containers)</see></description>
    /// </item>
    /// <item>
    /// <description><see href="https://learn.microsoft.com/en-us/microsoft-365/cloud-storage-partner-program/rest/files/getecosystem">GetEcosystem (files)</see></description>
    /// </item>
    /// <item>
    /// <description><see href="https://learn.microsoft.com/en-us/microsoft-365/cloud-storage-partner-program/rest/ecosystem/getrootcontainer">GetRootContainer (ecosystem)</see></description>
    /// </item>
    /// </list>
    /// </summary>
    public bool SupportsEcosystem { get; set; }

    /// <summary>
    /// 表示主机是否支持 <see href="https://learn.microsoft.com/en-us/microsoft-365/cloud-storage-partner-program/rest/ecosystem/getfilewopisrc">GetFileWopiSrc (ecosystem)</see> 操作。
    /// </summary>
    public bool SupportsGetFileWopiSrc { get; set; }

    /// <summary>
    /// 包含主机支持的 <see href="https://learn.microsoft.com/en-us/microsoft-365/cloud-storage-partner-program/rest/concepts#share-url">Share URL</see> 类型的字符串数组。
    /// 这些类型可以在X-WOPI-UrlType请求头中传递，用于指示 <see href="https://learn.microsoft.com/en-us/microsoft-365/cloud-storage-partner-program/rest/files/getshareurl">GetShareUrl (files)</see> 操作返回哪种Share URL类型。
    /// <para> 可能的值：
    /// <list type="bullet">
    /// <item>
    /// <description>ReadOnly - 此类型的Share URL允许用户使用URL查看文件，但不允许编辑文件。</description>
    /// </item>
    /// <item>
    /// <description>ReadWrite - 此类型的Share URL允许用户使用URL查看和编辑文件。</description>
    /// </item>
    /// </list>
    /// </para>
    /// </summary>
    public IEnumerable<string> SupportedShareUrlTypes { get; set; }

    /// <summary>
    /// 表示主机是否支持用户通过受限URL在文件上进行有限操作的情景链接。
    /// </summary>
    public bool SupportsScenarioLinks { get; set; }

    /// <summary>
    /// 表示主机是否支持使用存储在文件中的凭据调用安全数据存储的操作。
    /// </summary>
    public bool SupportsSecureStore { get; set; }

    /// <summary>
    /// 表示主机是否支持使用WOPI客户端创建新文件的操作。
    /// </summary>
    public bool SupportsFileCreation { get; set; }

    /// <summary>
    /// 表示主机是否支持以下WOPI操作：
    /// <list type="bullet">
    /// <item>
    /// <description><see href="https://learn.microsoft.com/en-us/microsoft-365/cloud-storage-partner-program/rest/files/putfile">PutFile</see></description>
    /// </item>
    /// <item>
    /// <description><see href="https://learn.microsoft.com/en-us/microsoft-365/cloud-storage-partner-program/rest/files/putrelativefile">PutRelativeFile</see></description>
    /// </item>
    /// </list>
    /// </summary>
    public bool SupportsUpdate { get; set; }

    /// <summary>
    /// 表示主机是否支持 <see href="https://learn.microsoft.com/en-us/microsoft-365/cloud-storage-partner-program/rest/files/renamefile">RenameFile</see> 操作。
    /// </summary>
    public bool SupportsRename { get; set; }

    /// <summary>
    /// 表示主机是否支持 <see href="https://learn.microsoft.com/en-us/microsoft-365/cloud-storage-partner-program/rest/files/deletefile">DeleteFile</see> 操作。
    /// </summary>
    public bool SupportsDeleteFile { get; set; }

    /// <summary>
    /// 表示主机是否支持 <see href="https://learn.microsoft.com/en-us/microsoft-365/cloud-storage-partner-program/rest/files/putuserinfo">PutUserInfo</see> 操作。
    /// </summary>
    public bool SupportsUserInfo { get; set; }
}
